//
//  UIView+Frame.m
//  BuDeJie
//
//  Created by 梁梓烽 on 16/4/1.
//  Copyright © 2016年 liangzifeng. All rights reserved.
//

#import "UIView+Frame.h"

@implementation UIView (Frame)

+(instancetype)lzf_viewFromXib
{
    return [[NSBundle mainBundle]loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil].firstObject;
}

- (void)setLz_centerX:(CGFloat)lz_centerX
{
    CGPoint center=self.center;
    center.x=lz_centerX;
    self.center=center;
}

-(void)setLz_centerY:(CGFloat)lz_centerY
{
    CGPoint center=self.center;
    center.y=lz_centerY;
    self.center=center;
}

-(void)setLz_x:(CGFloat)lz_x
{
    CGRect rect=self.frame;
    rect.origin.x=lz_x;
    self.frame=rect;
}

-(void)setLz_y:(CGFloat)lz_y
{
    CGRect rect=self.frame;
    rect.origin.y=lz_y;
    self.frame=rect;
}

-(void)setLz_width:(CGFloat)lz_width
{
    CGRect rect=self.frame;
    rect.size.width=lz_width;
    self.frame=rect;
}


-(void)setLz_height:(CGFloat)lz_height
{
    CGRect rect=self.frame;
    rect.size.height=lz_height;
    self.frame=rect;
}


-(CGFloat)lz_centerX
{
    return  self.center.x;
}

-(CGFloat)lz_centerY
{
    return  self.center.y;
}

-(CGFloat)lz_x
{
    return  self.frame.origin.x;
}


- (CGFloat)lz_y
{
    return  self.frame.origin.y;
}



-(CGFloat)lz_width
{
    return  self.frame.size.width;
}

-(CGFloat)lz_height
{
    return  self.frame.size.height;
}







@end
